<template>
	<!-- 搜索证书 -->
	<!-- <view class="container">
		<view class="tips text_black">奥北体能平台证书查询，请输入您的证书编号</view>
		<view class="input">
			<view class="input_after">证书编号</view>
			<input placeholder="请输入证书编号" v-model="number" :maxlength="11"/>
		</view>
		<view class="button" style="background:#FF6E00;" @click="gohref">查询证书</view>
		<view class="image">
			<image src="../../static/imgs/login/authentication.png"></image>
		</view>
	</view> -->
	<!-- 购买奖杯证书等支付完成页 -->
	<view class="container">
		<view class="cert-header">
			<image src="../../static/imgs/mine/cert-listimg.png" mode="aspectFit" class="cert-img"></image>
			<view>
				<view class="cert-name">{{data.sport_title}} 纸质证书</view>
				<view class="cert-grade text_opblack">{{data.name}} {{data.section}}阶段</view>
			</view>
		</view>
		<view class="cert-item">
			<image src="../../static/imgs/mine/address.png"></image>
			<view class="cert-item_class">
				<view class="cert-item_title text_black">
					<text class="cert-bold">{{data.receiver_name}}</text>
					<text>{{data.receiver_phone}}</text>
				</view>
				<view class="cert-item_tips text_opblack">{{data.receiver_address}}</view>
			</view>
		</view>
		<view class="cert-yunshu">
			<view class="cert-item" v-if="data.ship_number.length==0">
				<image src="../../static/imgs/mine/fahuo.png"></image>
				<view class="cert-item_class">
					<view class="cert-item_title text_black">您的纸质证书已准备发货</view>
					<view class="cert-item_tips text_opblack">请您耐心等待</view>
				</view>
			</view>
			<view class="cert-item" v-else>
				<image src="../../static/imgs/mine/yunshu.png"></image>
				<view class="cert-item_class">
					<view class="cert-item_title text_black">您的纸质证书已发货</view>
					<view class="cert-item_tips text_opblack">{{data.ship_name}} 单号{{data.ship_number}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {getSportOrder} from "../../static/js/api/games.js";
	export default {
		data() {
			return {
				params:{},
				data:{}
			}
		},
		onLoad(option) {
			if(option.params){
				this.params = JSON.parse(option.params)
				this.getData()
			}
		},
		methods: {
			getData(){
				getSportOrder({
					sport_id:this.params.sport_id,
					sport_user_id:this.params.user_id
				}).then(res=>{
					console.log(res)
					this.data = res
				})
			}
			// gohref(){
			// 	if(this.number==null||this.number.length==0){
			// 		uni.showToast({
			// 			title:"请输入证书编号",
			// 			icon:'none'
			// 		})
			// 	}else{
			// 		uni.navigateTo({
			// 			url:"/pages/mine/certificate",
			// 		})
			// 	}
			// },
		}
	}
</script>

<style lang="scss" scoped>
	@import url("./search.scss");
	.container{
		background-color: transparent!important;
	}
	.text_black{
		color: $uni-text-color-black!important;
	}
	.text_opblack{
		color: $uni-text-color-opblack!important;
	}
	.cert-bold{
		font-weight: bold;
		margin-right: 10rpx;
	}
</style>